﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace IHISCETeim.Web
{
    public class IHISCETeimDict
    {

        /// <summary>
        /// 初始化工位信息
        /// </summary>
        private static void initGongWeiDict()
        {
            _GongWeiDict = new Dictionary<string, string>();
            _GongWeiDict.Add("A-01", "组装");
            _GongWeiDict.Add("A-02", "");
            _GongWeiDict.Add("A-03", "");
            _GongWeiDict.Add("A-04", "");
            _GongWeiDict.Add("A-05", "");
            _GongWeiDict.Add("A-06", "");
            _GongWeiDict.Add("A-07", "");
            _GongWeiDict.Add("A-08", "");
            _GongWeiDict.Add("A-10", "");
            _GongWeiDict.Add("B-01", "");
            _GongWeiDict.Add("B-02", "");
            _GongWeiDict.Add("B-03", "");
            _GongWeiDict.Add("B-04", "");
            _GongWeiDict.Add("B-05", "");
            _GongWeiDict.Add("B-06", "");
            _GongWeiDict.Add("B-07", "");
            _GongWeiDict.Add("C-01", "");
            _GongWeiDict.Add("C-02", "");
            _GongWeiDict.Add("C-03", "");
            _GongWeiDict.Add("C-04", "");
            _GongWeiDict.Add("C-05", "");
            _GongWeiDict.Add("C-06", "");
            _GongWeiDict.Add("E-01", "");
            _GongWeiDict.Add("F-01", "");
            _GongWeiDict.Add("F-02", "");
            _GongWeiDict.Add("F-03", "");
            _GongWeiDict.Add("F-04", "");
            _GongWeiDict.Add("F-05", "");
        }
        private static Dictionary<string, string> _GongWeiDict = null;
        protected static Dictionary<string, string> GongWeiDict
        {
            get
            {
                if (_GongWeiDict == null)
                {
                    initGongWeiDict();
                }
                return _GongWeiDict;
            }
        }
        /// <summary>
        /// 获取所有工位值
        /// </summary>
        /// <returns></returns>
        public static List<string> GetGongWeiKey()
        {
            return GongWeiDict.Keys.ToList<string>();
        }
        /// <summary>
        /// 获取工位对应的名称
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        public static string GetGongWeiValue(string key)
        {
            string va=key.ToUpper();

            GongWeiDict.TryGetValue(key.ToUpper(), out va);

            return string.IsNullOrEmpty(va)?key.ToUpper():va;
        }

    }
}